package com.pyk.service.impl;


import com.pyk.entity.CourseCategory;
import com.pyk.mapper.CourseCategoryMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

@Service
    public class CourseCategoryService {
    @Resource
    private CourseCategoryMapper courseCategoryMapper;
    public void add(CourseCategory courseCategory) {
        courseCategory.setCreate_time(LocalDateTime.now());
        courseCategoryMapper.insert(courseCategory);
    }
    public void update(CourseCategory courseCategory) {

        courseCategoryMapper.updateById(courseCategory);
    }
    public void deleteById(Integer id) {

        courseCategoryMapper.deleteById(id);
    }
    public void deleteBatch(List<Integer> ids) {
        courseCategoryMapper.deleteBatch(ids);
    }
    public CourseCategory selectById(Integer id) {

        return courseCategoryMapper.selectById(id);
    }
    public List<CourseCategory> selectAll() {

        return courseCategoryMapper.selectAll();
    }
    public List<CourseCategory> selectPage( Integer pageNo, Integer pageSize) {
        return courseCategoryMapper.selectPage();
    }
}